<?php
?>
<div id="home-search-div">
	<?php echo form_open('search/index'); ?>
	<input type="text" name="search_text" value="" style="width:400px" />
	<input type="submit" name="home_search" value="Search" />
</div>

<div id="demo">
  <label for="ac-input">Enter the name of a US state:</label><br>
  <input id="ac-input" type="text">
</div>

<script> 
YUI({ filter: 'raw' }).use("autocomplete", "autocomplete-highlighters", function (Y) {
  Y.one('#ac-input').plug(Y.Plugin.AutoComplete, {
    resultHighlighter: 'phraseMatch',
    resultListLocator: 'users',
    resultTextLocator: 'username',
    source: '<?php echo base_url(); ?>/index.php/user/ajax_search_json?q={query}'
  });
});
</script> 